package object_oriented;

/**
 * @ClassName Person
 * @Deacription TODO
 * @Author 谢忠辉
 * @Date 2021/3/17 0017 15:04
 **/
public class Person  implements Cloneable{
    private String name ;
    public Son son = new Son();
    Person(){

    }
    Person( String name ){
        this.name = name ;
    }

    public String getInfo(){
        System.out.println("内部类的字段:" + son.age);
        System.out.println("定义的内部类对象地址:" + son);
        return name ;
    }
    public void setName(String name){
        this.name = name ;
    }
    class Son{
        public String age ;
        Son(){
        }

    }
    @Override
    protected Object clone() throws CloneNotSupportedException {

        Object o = super.clone() ;
        return o;
    }
}
